WORD FirstSizeX; // the width of the rectangle to blit as the first column
WORD FirstSizeY; // the height of the rectangle to blit as the first row
WORD SecondMinX; // the left edge of the second column
WORD SecondMinY; // the top edge of the second column
WORD SecondSizeX; // the width of the second column
WORD SecondSizeY; // the height of the second column
WORD Pos; // used as starting position in the "exponential" blit
WORD Size; // used as bitmap size in the "exponential" blit
FirstSizeX = MIN(SrcSizeX-SrcOffsetX,RECTSIZEX(DstBounds)); // the width of the first tile, this is either the rest of the tile right to SrcOffsetX or the width of the dest rect, if the rect is narrow
SecondMinX = DstBounds->MinX+FirstSizeX; // the start for the second tile (if used)
SecondSizeX = MIN(SrcOffsetX,DstBounds->MaxX-SecondMinX+1); // the width of the second tile (we want the whole tile to be SrcSizeX pixels wide, if we use SrcSizeX-SrcOffsetX pixels for the left part we'll use SrcOffsetX for the right part)
FirstSizeY = MIN(SrcSizeY-SrcOffsetY,RECTSIZEY(DstBounds)); // the same values are calculated for y direction
WORD OffsetX; // the offset within the tile in x direction
WORD OffsetY; // the offset within the tile in y direction
struct BackFillInfo *BFI = (struct BackFillInfo *)Hook; // get the data for our backfillhook (but __saveds is nonetheless required because this function needs GfxBase)
OffsetX = BFM->Bounds.MinX-BFI->Options.OffsetX; // The first tile normally isn't totally visible => calculate the offset (offset 0 would mean that the left edge of the damage rectangle coincides with the left edge of a tile)
if (BFI->Options.CenterX) // horizontal centering?
// the bitmap is copied to a friend bitmap of the screen to speed up rendering with gfxboards (no c2p/p2c!); this additionally allows to use this copy as a "picture cache", i.e. if the picture is 2x2 the copy can be made 16x16 (with 64 tiles) or whatever to speed up rendering
if (BFI->BitMap = AllocBitMap(BFI->CopyWidth,BFI->CopyHeight,Depth, BMF_MINPLANES ,(stc ? BitMap: Scr->RastPort.BitMap)))
{
struct Rectangle CopyBounds;
CopyBounds.MinX = 0;
CopyBounds.MinY = 0;
CopyBounds.MaxX = BFI->CopyWidth-1;
CopyBounds.MaxY = BFI->CopyHeight-1;
/*
if(CyberGfxBase && destmode==PMODE_V43)
{
struct pdtBlitPixelArray bpa;
bpa.MethodID=PDTM_READPIXELARRAY;
bpa.pbpa_PixelArray=; /* Source PixelArray */
bpa.pbpa_PixelArrayMode=; /* Format Mode of the Source PixelArray; see cybergraphics.h */
bpa.pbpa_PixelArrayMod=; /* Bytes to add to the next line in the Source PixelArray */
bpa.pbpa_LeftEdge=; /* XStart of the Dest */
bpa.pbpa_TopEdge=; /* YStart of the Dest */
bpa.pbpa_Width=; /* Width of the Source PixelArray */
bpa.pbpa_Height=; /* Height of the Source PixelArray */
DoMethod(
CopyTiledBitMap(BFI->BitMap,0,0,BFI->BitMapHeader->bmh_Width,BFI->BitMapHeader->bmh_Height,BFI->BitMap,&CopyBounds); // blit the tiles to the bitmap
}
else*/
{
CopyTiledBitMap(BitMap,0,0,BFI->BitMapHeader->bmh_Width,BFI->BitMapHeader->bmh_Height,BFI->BitMap,&CopyBounds); // blit the tiles to the bitmap
DisposeDTObject(BFI->PictureObject); // datatype object is freed here, because - although a different bitmap is used for blitting to the screen - the pens have to stay allocated